home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_rivervoice.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  213 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_RiverVoice.cog
  4. #
  5. # Say line control for the river area in SHW
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols        
  13.     
  14. #...............MESSAGES................................    
  15.     message     startup
  16.     message     taken
  17.     message     activated
  18.  
  19. #...............ACTORS................................    
  20.     
  21.     thing       player                              local
  22.     thing       indyActor      
  23.     
  24. #...............PROPS................................    
  25.     thing        door                                mask=0x408
  26.     thing        icedam
  27.     thing        flask
  28.  
  29.     thing       in_mv0      
  30.     thing       in_lk0      
  31.     
  32. #...............CAMERAS................................    
  33.     thing       doorCam      
  34.     thing       roomCam      
  35.     thing        roomCam2
  36.     
  37.     thing       curCam                              local
  38.  
  39. #...............CAMERA TARGETS................................    
  40.     thing       camTarg1                            local      
  41.  
  42. #...............SOUNDS................................    
  43.     sound       inflaskspot=sw01j07.wav             local       # some lamp oil...
  44.     sound       inrivspot=SW01J02.WAV                  local       # the stream is frozen solid...
  45.     sound       inrivhint=sw01j02a.wav              local       # if I could melt the ice here...
  46.     sound       enter_cue=mus_gen_eerie2.wav        local       # music cue as indy enters the cave...
  47.     
  48. #...............KEYFRAMES................................    
  49.     keyframe    inStand1=0in_stand4.key             local
  50.     keyframe    inThinking=0in_thinking_4_4.key     local
  51.     keyframe    inStand2=0in_stand1_bd_4.key        local
  52.     
  53.  
  54. #...............TEMPLATES................................    
  55.     template    ghostTpl=ghost                        local
  56.  
  57. #...............VARIABLES................................    
  58.     int         sceneplayed=0                        local
  59.     int         cueplayed=0                            local
  60.     int         inTrack                                local
  61.     int         doorhit=0                            local
  62.  
  63.     flex        rotref                                local
  64.  
  65.     vector        indyPos                                local    
  66.     
  67.  
  68. end
  69.  
  70. # ========================================================================================
  71.  
  72. code
  73.  
  74. startup:
  75.     player = GetLocalPlayerThing();
  76.     return;
  77.     
  78. # ========================================================================================
  79.  
  80. activated:
  81.  
  82.     if (GetSenderRef() != door) return;
  83.     {
  84.         If (doorhit == 1) return;
  85.         doorhit = 1;
  86.         If (sceneplayed == 0)
  87.         {
  88.         if (MakeMeStop() == -1) return;
  89.         
  90.         sceneplayed = 1;
  91.         
  92.         # get the camera and initialize cutscene 
  93.         curCam = GetCurrentCamera();
  94.  
  95.         DeselectWeaponWait(player);
  96.         
  97.         StartCutScene(1);
  98.         SetCameraLookInterp(2, 0);
  99.         SetCameraPosInterp(2, 0);
  100.     
  101.         # Set up actor
  102.         CopyPlayerHolsters(player, indyActor);
  103.         CopyOrientAndPos(player, indyActor);
  104.         AISetCutSceneMode(indyActor);
  105.         SetThingFlags(player, 0x80000);
  106.         ClearThingFlags(indyActor, 0x80000);
  107.     
  108.         rotref=(GetThingMaxRotVel(indyActor));
  109.         SetThingMaxRotVel(indyActor, 150);
  110.         AISetLookThingEyeLevel(indyActor, door);
  111.     
  112.         # move cam to known position
  113.         SetExtCamOffsetToThing(doorCam);
  114.  
  115.         # create ghost object at actors' position, lock it to the actor
  116.         camTarg1 = CreateThingAtPos(ghostTpl, GetThingSector(indyActor), GetThingPos(indyActor), '0 0 0');
  117.         AttachThingToThingEx(camTarg1, indyActor, 0x000C);
  118.         
  119.         Sleep(0.5);
  120.  
  121.         # animate indyActor, open door
  122.         PlayMode(indyActor, 60, 1);
  123.         Rotate(door, 90, 1, 2.0);
  124.  
  125.         Sleep(1.0);
  126.         
  127.         # play creepy music cue
  128.         PlaySoundLocal(enter_cue, 1.0, 0.0, 0x0, 0);
  129.         
  130.         
  131.         Sleep(1.0);
  132.  
  133.         # move indyActor into the room
  134.         AISetLookThingEyeLevel(indyActor, in_mv0);
  135.         AISetMoveSpeed(indyActor, 1.5);
  136.         AISetMoveThing(indyActor, in_mv0, 0);
  137.         Sleep(1.5);
  138.  
  139.         # cut to camera 2 in the room
  140.         SetCameraSecondaryFocus(2, camTarg1);
  141.         SetCameraFocus(2, roomCam);
  142.         SetCurrentCamera(2);
  143.         Sleep(0.5);
  144.         MoveThingToPos(roomCam, GetThingPos(roomCam2), 4.0);
  145.  
  146.         # indyActor looks at the ice dam
  147.         AIEnableHeadTracking(indyActor, in_lk0);
  148.         Sleep(1.0);
  149.         DetachThing(camTarg1);
  150.  
  151.         # pan from the actor to the dam
  152.         MoveThingToPos(camTarg1, GetThingPos(icedam), 3.0);
  153.  
  154.         # Indy thinks as the camera moves over him
  155.         AIWaitForStop(indyActor);
  156.         
  157.         # close the door
  158.         Rotate(door, -90, 1, 2.0);
  159.         doorhit = 0;
  160.         AISetLookThing(indyActor, icedam);
  161.         inTrack = PlayKey(indyActor, inStand1, 2, 0x0, 0);
  162.         PlayVoice(indyActor, inrivspot, 1.0, 1);
  163.         StopKey(indyActor, inTrack, 0.5);
  164.  
  165.         # Restore the player
  166.         CopyOrientAndPos(indyActor, player);
  167.         AIClearCutSceneMode(indyActor);
  168.         SetThingFlags(indyActor, 0x80000);
  169.         ClearThingFlags(player, 0x80000);
  170.         ClearActorFlags(player, 0x200000);
  171.  
  172.         # restore the camera
  173.         RestoreExtCam();
  174.         SetCameraPosition(curCam, GetThingPos(roomCam2));
  175.         SetCurrentCamera(curCam);
  176.         RestoreExtCam();
  177.         Sleep(0.01);
  178.         EndCutScene();
  179.         
  180.         Sleep(3.0);
  181.         # flask clue line
  182.         PlayVoice(player, inrivhint, 1.0, 1);
  183.         }
  184.  
  185.         else
  186.         {
  187.             PlayMode(player, 60, 1);
  188.             Rotate(door, 90, 1, 2.0);
  189.             ClearActorFlags(player, 0x200000);
  190.             Sleep(5.0);
  191.             Rotate(door, -90, 1, 2.0);
  192.             doorhit = 0;
  193.         }
  194.     }
  195.  
  196. return;
  197.  
  198. # ========================================================================================
  199. taken:
  200.  
  201.         If (GetSenderRef() == flask)
  202.         {
  203.         PlayVoice(player, inflaskspot, 1.0, 1);
  204.         }
  205.         
  206. return;
  207.  
  208.  
  209. # ========================================================================================
  210. end
  211.  
  212.  
  213.